gtkicontheme: check if the context quark string is not null
authorIgnacio Casal Quinteiro <icq@gnome.org>
Mon, 17 Oct 2016 11:02:26 +0000 (13:02 +0200)
committerIgnacio Casal Quinteiro <icq@gnome.org>
Mon, 17 Oct 2016 11:04:31 +0000 (13:04 +0200)
On windows you might not have a theme installed by default which
means that when trying to create the context quark it will fail.
If then we try to replace a NULL key in the hash table it will crash.

https://bugzilla.gnome.org/show_bug.cgi?id=769859

gtk/gtkicontheme.c

index a2255d4933099bf06c5d596e4648caa23b2b9f71..e31c75a7923456d25b495d0d6cf30167a95adcbf 100644 (file)
@@ -3179,7 +3179,8 @@ theme_list_contexts (IconTheme  *theme,
       dir = l->data;
 
       context = g_quark_to_string (dir->context);
-      g_hash_table_replace (contexts, (gpointer) context, NULL);
+      if (context != NULL)
+        g_hash_table_replace (contexts, (gpointer) context, NULL);
 
       l = l->next;
     }